import http from '../request.js'

// 获取菜单列表
let menuGetList = (url, params) => {
    return http.req(
        'get',
        url = 'system/menu/getList',
        params,
        null
    )
}

// 获取菜单详情
let menuGetInfo = (url, menuId) => {
    return http.req(
        'get',
        url = 'system/menu/getInfo?menuId='+menuId,
        null,
        null
    )
}

// 添加菜单
let menuAdd = (url, data) => {
    return http.req(
        'post',
        url = 'system/menu/add',
        null,
        data
    )
}

// 删除菜单
let menuRemove = (url, menuId) => {
    return http.req(
        'delete',
        url = 'system/menu/remove?menuId=' + menuId,
        null,
        null
    )
}

// 编辑菜单
let menuEdit = (url, data) => {
    return http.req(
        'put',
        url = 'system/menu/edit',
        null,
        data
    )
}

export default {
    menuGetList,
    menuGetInfo,
    menuAdd,
    menuRemove,
    menuEdit
}